package com.inventory.api.dao;

import com.inventory.api.entity.StockTransaction;
import com.inventory.api.signUpReq.RecordDetailsSignUpReq;
import org.springframework.data.repository.CrudRepository;

import java.util.List;
import java.util.Map;

/**
 * Created by lihu on 2018/2/1.
 */
public interface StockTransactionDao extends CrudRepository<StockTransaction, String> {


    List<StockTransaction> findByRefIdOrderByIdDesc(String refId);


    /***
     * 条件查询商品出入库信息
     *
     * @param signUpReq
     * @return
     */
    List<Map<String, Object>> queryStockDetails(RecordDetailsSignUpReq signUpReq);


    /***
     * 条件查询商品出入库总数量
     *
     * @param signUpReq
     * @return
     */
    long queryStockDetailsNumber(RecordDetailsSignUpReq signUpReq);
}
